ngl: add front cache to reduce uniform changes
authorChristian Hergert <chergert@redhat.com>
Fri, 12 Mar 2021 18:16:52 +0000 (10:16 -0800)
committerChristian Hergert <chergert@redhat.com>
Fri, 12 Mar 2021 19:22:59 +0000 (11:22 -0800)
commit0b7d8e19c3b4cffe450c0e9a31ea4e0d8419b65b
tree572b5066d63c0501b2b6400a3fa3712dab458075
parent7f292d34bd1841df1ea214037d0549b256f315da
ngl: add front cache to reduce uniform changes

Since we make full snapshots when recording uniform state of batches, we
need to perform some deduplication to avoid so many repeated uniform calls.

This uses a closed hashtable to determine if we are likely changing the
value to something new.

This does not currently compare values, it instead only compares that we
are going to point at a new offset into the uniform buffer. We could go
further if we compare upon updating values (we did that early on in the
prototype) so that offsets are less likely to be changed.
gsk/ngl/gsknglcommandqueue.c
gsk/ngl/gskngluniformstate.c
gsk/ngl/gskngluniformstateprivate.h